﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication1.BLL;

namespace WebApplication1.Controllers
{
    public class ClickModelsLogController : Controller
    {
        /// <summary>
        /// 模块点击日志
        /// </summary>
        /// <param name="userId">用户id</param>
        /// <param name="modelsNo">模块编号</param>
        /// <param name="appType">app类型，1=家园，2=园丁</param>
        /// <returns></returns>
        public string AddClickModelsLog(string userId, int modelsNo, int appType)
        {
            int efcount = 0;
            string msg = "";
            try
            {
                efcount = new ClickModelsLogBLL().Add(userId, modelsNo, appType);
            }
            catch (Exception ex)
            {
                msg = ex.Message;
            }
            String callbackFunName = Request["jsoncallback"];
            string back = callbackFunName + "({code:" + efcount + ",msg:\"" + msg + "\"})";
            return back;
        }
    }
}